//
//  HuangwwFaceAndGestureHeader.h
//  Pods
//
//  Created by huangwenwu on 2020/1/14.
//

#ifndef HuangwwFaceAndGestureHeader_h
#define HuangwwFaceAndGestureHeader_h

//手机系统
#define ksystemVersion11 [[[UIDevice currentDevice] systemVersion] floatValue] >= 11
#define iPhoneX \
({BOOL isPhoneX = NO;\
if (@available(iOS 11.0, *)) {\
isPhoneX = [[UIApplication sharedApplication] delegate].window.safeAreaInsets.bottom > 0.0;\
}\
(isPhoneX);})

//永久存储对象
#define kSetUserDefaults(object, key)                                                                                                 \
({                                                                                                                                             \
NSUserDefaults * defaults = [NSUserDefaults standardUserDefaults];                                                                         \
[defaults setObject:object forKey:key];                                                                                                    \
[defaults synchronize];                                                                                                                    \
})
//获取对象
#define kGetUserDefaults(key) [[NSUserDefaults standardUserDefaults] objectForKey:key]
//删除某一个对象
#define kRemoveUserDefaults(key)                                         \
({                                                                          \
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];       \
[defaults removeObjectForKey:key];                                     \
[defaults synchronize];                                                 \
})
//清除 NSUserDefaults 保存的所有数据
#define kRemoveAllUserDefaults  [[NSUserDefaults standardUserDefaults] removePersistentDomainForName:[[NSBundle mainBundle] bundleIdentifier]]

// 持久化key
// 是否开通faceid 或 指纹
#define kAuthIDopen [NSString stringWithFormat:@"kAuthIDopen%@",@"13070924231"]
// 是否开通Face ID 或 指纹支付
#define kAuthIDPayopen [NSString stringWithFormat:@"kAuthIDPayopen%@",@"13070924231"]
// 是否开启 手势解锁
#define kGestureOpen [NSString stringWithFormat:@"kGestureOpen%@",@"13070924231"]
// 是否显示连线
#define kShowLine [NSString stringWithFormat:@"kShowLine%@",@"13070924231"]
// 是否第一次启动app
#define kisFirst  @"isFirst"
// 定位手势解锁和id解锁优先级 1. 手势解锁。2.id解锁
#define kLockType [NSString stringWithFormat:@"kLockType%@",@"13070924231"]
// 保存指纹Face ID信息
#define kAuthIDData @"kAuthIDData"
// 保存手势解锁次数
#define kGestureCount @"kGestureCount"
#endif /* HuangwwFaceAndGestureHeader_h */
